Rails.application.routes.draw do
  get 'blogs/new'
  get 'blogs/index'
  root 'welcome#index'
  resources :users do
    get :blogs, on: :member
  end
  resources :blogs
  resources :sessions, only: [:create, :destroy, :new]
  
  namespace :admin do
    root 'users#index'
    resources :users do
      collection do
        get :search
      end
    end
  end
end
